# Contributor: Andy Postnikov <apostnikov@gmail.com>
# Maintainer: Andy Postnikov <apostnikov@gmail.com>
pkgname=php7-tideways_xhprof
_extname=tideways_xhprof
pkgver=5.0.4
pkgrel=1
pkgdesc="Modern XHProf compatible Profiler for PHP 7"
url="https://tideways.com"
arch="all !s390x" # fails to build https://github.com/tideways/php-xhprof-extension/issues/72
license="Apache-2.0"
depends="php7-common"
makedepends="php7-dev"
source="php-$_extname-$pkgver.tar.gz::https://github.com/tideways/php-xhprof-extension/archive/v$pkgver.tar.gz"
builddir="$srcdir/php-xhprof-extension-$pkgver"

build() {
	phpize7
	./configure --prefix=/usr --with-php-config=/usr/bin/php-config7
	make
}

check() {
	make NO_INTERACTION=1 REPORT_EXIT_STATUS=1 test
}

package() {
	make INSTALL_ROOT="$pkgdir" install

	local _confdir="$pkgdir"/etc/php7/conf.d
	install -d $_confdir
	echo "extension=$_extname" > $_confdir/$_extname.ini
}

sha512sums="bc7689060e33100ed43ed4ec0a251f6b4d9b7fcd3420e3c1208f400fc68d302a2fced90641016e55b8ee434e4d0de91703a2253c2515f16200fc0e330e4f60c2  php-tideways_xhprof-5.0.4.tar.gz"
